//
//  JsonAddressModel.m
//  zjGovernment
//
//  Created by 胡胜冬 on 2017/2/18.
//  Copyright © 2017年 胡胜冬. All rights reserved.
//

#import "JsonAddressModel.h"

@implementation JsonAddressModel

#pragma mark - 解析json

+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString {
    if (jsonString == nil) {
        return nil;
    }
    
    NSError  * error;
    NSString * str22 = [NSString stringWithContentsOfFile:jsonString
                                                 encoding:NSUTF8StringEncoding
                                                    error:&error];
    
    if (error) {
        return nil;
    }
    
    NSData  * jsonData = [str22 dataUsingEncoding:NSUTF8StringEncoding];
    NSError * err;
    NSDictionary * dic = [NSJSONSerialization JSONObjectWithData:jsonData
                                                         options:NSJSONReadingMutableContainers
                                                           error:&err];
    if(err) {
        NSLog(@"json解析失败：%@",err);
        return nil;
    }
    return dic;
}

@end
